package com.plugin.manager;

import com.plugin.common.PluginService;

import java.util.List;

public class Main {


    public static void main(String[] args) {
        try {
            List<Plugin> plugins = Config.getPlugins();
            PluginManager manager = null;

            manager = new PluginManager(plugins);

            for (Plugin plugin : plugins) {
                PluginService pluginService = manager.getInstance(plugin.getClassName());
                System.out.println("开始执行【 " + plugin.getName() + "】插件...");
                // 调用插件
                pluginService.service();
                System.out.println("【 " + plugin.getName() + "】 插件执行完成...");
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
